<script type="text/javascript">
    addFormId = '<?php echo "{$modelName}AddForm"; ?>';
    editFormId = '<?php echo "{$modelName}EditForm"; ?>';
</script>
<div id="coreDataGrid">
    <table id="datagrid">  
        <thead>
            <tr>   
                <?php
                foreach ($fields as $key => $value) {
                    if($value=='integer'){
                        continue;
                    }
                ?> 
                    <th data-options="field:'<?php echo $key; ?>'" sortable="true"><?php echo __(AppController::fieldNameToLocale($key)); ?></th>  
                <?php
                }
                ?>
            </tr>
        </thead>  
    </table> 
    <div id="toolbar">
        <a href="#" class="easyui-linkbutton" iconCls="icon-plus" plain="true" onclick="newRegister()"><?php echo __('Add'); ?></a>
        <a href="#" class="easyui-linkbutton" iconCls="icon-edit-signiture" plain="true" onclick="editRegister()"><?php echo __('Edit'); ?></a>
        <a href="#" class="easyui-linkbutton" iconCls="icon-minus" plain="true" onclick="removeRegister()"><?php echo __('Delete'); ?></a>
        <input id="ss" class="easyui-searchbox"
               searcher="qq"
               prompt="<?php echo __('Search'); ?>" menu="#mm" style="width:300px"></input>

        <div id="mm" style="width:120px">
            <?php
            foreach ($fields as $key => $value) {
                if($key == "id" || ($value != 'string' && $value != 'text'))continue;
                ?> 
                <div name="<?php echo $key; ?>"><?php echo __(AppController::fieldNameToLocale($key)); ?></div>
                <?php
            }
            ?>
        </div>
    </div>


    <div id="dlg" class="easyui-dialog" data-options="maximized:true, iconCls:'icon-<?php echo $this->Html->getModuleIcon($moduleName); ?>',title:'<?php echo ucwords(str_replace("_", " ", $moduleName)); ?> Data Grid Form'" style="width:800px;height:400px;padding:10px 20px"
         closed="true" buttons="#dlg-buttons" resizable="true" maximizable="true" >
    </div>
    <div id="dlg-buttons">
        <a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveRegister();"><?php echo __('Save'); ?></a>
        <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')"><?php echo __('Cancel'); ?></a>
    </div>
</div>